.floating-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    min-height: 300px;
    max-height: 80vh;
    padding: 12px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
    will-change: left, top;
}

.floating-panel:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.floating-panel.dragging {
    transition: none !important;
    cursor: move;
    user-select: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.floating-panel.minimized {
    width: auto;
    min-width: 120px;
    min-height: auto;
    background: rgba(255, 255, 255, 0.95);
}

.floating-panel.minimized .panel-content {
    display: none;
}

.floating-panel.expanded {
    height: 800px;
}

.panel-header {
    margin: -12px -12px 0 -12px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #7F7FD5, #86A8E7, #91EAE4);
    color: #fff;
    border-radius: 8px 8px 0 0;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 32px;
}

.panel-header .minimize-btn,
.panel-header .close-btn {
    cursor: pointer;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.panel-header .minimize-btn:hover,
.panel-header .close-btn:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.2);
}

.panel-header .close-btn:hover {
    background-color: rgba(255, 87, 87, 0.8);
}

.panel-button {
    padding: 6px 12px;
    margin: 0;
    border: 1px solid #E6E8F0;
    border-radius: 6px;
    background-color: #fff;
    color: #5C6AC4;
    font-size: 13px;
    transition: all 0.2s ease;
    flex: 0 0 auto;
    white-space: nowrap;
    min-width: 80px;
}

.panel-button:hover {
    background-color: #F5F7FF;
    border-color: #7F7FD5;
    color: #7F7FD5;
}

.panel-button span {
    margin-right: 6px;
    font-size: 14px;
}

.screenshot-highlight {
    outline: 2px solid #7F7FD5 !important;
    outline-offset: -2px !important;
    background-color: rgba(127, 127, 213, 0.08) !important;
}

body.selecting * {
    cursor: crosshair !important;
}

.chat-container {
    display: none;
    width: 100%;
    height: 600px;
    margin-top: 16px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.chat-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 左右分栏布局 */
.panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
    padding-top: 12px;
}

/* 左侧操作区 */
.panel-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 8px 0;
    border-bottom: 1px solid #E2E8F0;
    margin: 0;
}

/* 右侧内容显示区 */
.panel-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

/* 修改返回内容容器样式 */
.response-container {
    flex: 1;
    background: #F7FAFC;
    border-radius: 6px;
    padding: 12px;
    font-size: 13px;
    line-height: 1.5;
    overflow-y: auto;
    min-height: 200px;
    max-height: 400px; /* 限制最大高度 */
    margin-top: 0;
    position: relative; /* 用于折叠按钮定位 */
}

/* 添加渐变遮罩效果 */
.response-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, #F7FAFC);
    pointer-events: none;
    opacity: 0.8;
}

/* 返回内容文本样式优化 */
.response-text {
    position: relative;
    padding-bottom: 32px; /* 为展开按钮留出空间 */
}

/* 展开/收起按钮样式 */
.expand-btn {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 12px;
    border-radius: 12px;
    background: #EDF2F7;
    color: #4A5568;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #E2E8F0;
    transition: all 0.2s ease;
    z-index: 1;
}

.expand-btn:hover {
    background: #E2E8F0;
    color: #2D3748;
}

/* 展开状态样式 */
.response-container.expanded {
    max-height: 80vh;
}

.response-container.expanded::after {
    display: none;
}

/* 优化滚动条样式 */
.response-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.response-container::-webkit-scrollbar-track {
    background: transparent;
}

.response-container::-webkit-scrollbar-thumb {
    background: rgba(203, 213, 224, 0.8);
    border-radius: 3px;
    transition: all 0.2s ease;
}

.response-container:hover::-webkit-scrollbar-thumb {
    background: rgba(160, 174, 192, 0.8);
}

.response-container pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

/* 美化滚动条 */
.response-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.response-container::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.response-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.response-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 返回内容项样式 */
.response-item {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
    margin-bottom: 12px;
}

.response-time {
    color: #718096;
    font-size: 11px;
    margin-bottom: 6px;
}

.time-label {
    color: #A0AEC0;
}

.response-text h4 {
    margin: 6px 0;
    font-size: 13px;
    color: #4A5568;
}

.response-text pre {
    background: #FFFFFF;
    color: #F56565 !important;  /* 使用淡红色 */
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    font-size: 13px;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

/* 标题样式 */
.response-text pre b {
    color: #4C51BF;  /* 深紫色 */
    font-weight: 600;
}

/* 关键词高亮 */
.response-text pre strong {
    color: #805AD5;  /* 紫色 */
    font-weight: 600;
}

/* 重要内容 */
.response-text pre em {
    color: #3182CE;  /* 蓝色 */
    font-style: normal;
    font-weight: 500;
}

/* 特殊标记 */
.response-text pre mark {
    background: #FEF3C7;  /* 浅黄色背景 */
    color: #C05621;  /* 橙色 */
    padding: 2px 4px;
    border-radius: 3px;
}

/* 链接样式 */
.response-text pre a {
    color: #2B6CB0;  /* 蓝色 */
    text-decoration: none;
    border-bottom: 1px dashed #2B6CB0;
}

/* 代码片段 */
.response-text pre code {
    color: #6B46C1;  /* 紫色 */
    background: #F7FAFC;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

/* 引用内容 */
.response-text pre blockquote {
    border-left: 3px solid #4C51BF;
    margin: 8px 0;
    padding-left: 12px;
    color: #4A5568;
    font-style: italic;
}

/* 列表项前的标记 */
.response-text pre ul {
    list-style: none;
    padding-left: 20px;
}

.response-text pre ul li::before {
    content: '•';
    color: #4C51BF;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* 数字/字母标记 */
.response-text pre ol {
    list-style: none;
    counter-reset: item;
    padding-left: 20px;
}

.response-text pre ol li::before {
    content: counter(item) '.';
    counter-increment: item;
    color: #4C51BF;
    font-weight: bold;
    display: inline-block;
    width: 1.5em;
    margin-left: -1.5em;
}

/* 分隔线 */
.response-text pre hr {
    border: none;
    border-top: 1px solid #E2E8F0;
    margin: 12px 0;
}

/* 表格样式 */
.response-text pre table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
}

.response-text pre th {
    background: #F7FAFC;
    color: #2D3748;
    font-weight: 600;
    padding: 8px;
    border: 1px solid #E2E8F0;
}

.response-text pre td {
    padding: 8px;
    border: 1px solid #E2E8F0;
    color: #4A5568;
}

/* 注释文本 */
.response-text pre .comment {
    color: #718096;
    font-style: italic;
}

/* 警告文本 */
.response-text pre .warning {
    color: #C05621;
    background: #FFFAF0;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 错误文本 */
.response-text pre .error {
    color: #E53E3E;
    background: #FFF5F5;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 成功文本 */
.response-text pre .success {
    color: #2F855A;
    background: #F0FFF4;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 关键字 */
.response-text pre .keyword {
    color: #6B46C1;
    font-weight: 500;
}

/* 字符串 */
.response-text pre .string {
    color: #38A169;
}

/* 数字 */
.response-text pre .number {
    color: #D69E2E;
}

/* 函数名 */
.response-text pre .function {
    color: #3182CE;
}

/* 参数 */
.response-text pre .parameter {
    color: #805AD5;
}

/* 变量 */
.response-text pre .variable {
    color: #2B6CB0;
}

/* 优化性能相关的样式 */
.floating-panel * {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 标题和状态文字基础样式 */
.response-container h3 {
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #E2E8F0;
    transition: color 0.3s ease;
}

/* 初始状态 - 使用活力四射的绿色渐变 */
.response-container h3.status-waiting {
    color: #2D3748;
    background: linear-gradient(90deg, #48BB78 0%, #68D391 100%);  /* 翠绿到浅绿的渐变 */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
    background-size: 200% auto;
}

/* 思考中状态 - 使用橙色渐变 */
.response-container h3.status-thinking {
    color: #ED8936;
    background: linear-gradient(90deg, #ED8936 0%, #F6AD55 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s linear infinite;
    background-size: 200% auto;
}

/* 已回复状态 - 使用蓝色渐变 */
.response-container h3.status-replied {
    color: #4299E1;
    background: linear-gradient(90deg, #4299E1 0%, #63B3ED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
    background-size: 200% auto;
}

/* 错误状态 - 使用红色渐变 */
.response-container h3.status-error {
    color: #E53E3E;
    background: linear-gradient(90deg, #E53E3E 0%, #FC8181 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s linear infinite;
    background-size: 200% auto;
}

/* 添加微光动画效果 */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* 时间标签样式 */
.response-time {
    color: #718096;  /* 灰色 */
    font-size: 11px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.time-label {
    color: #A0AEC0;  /* 浅灰色 */
    margin-right: 4px;
}

.time-value {
    color: #4A5568;  /* 深灰色 */
    font-weight: 500;
}

/* 返回内容样式 */
.response-text h4 {
    color: #2D3748;  /* 保持标题颜色深灰 */
    font-weight: 600;
    font-size: 13px;
    margin: 12px 0 8px 0;
}

/* 代码块样式 */
.response-text pre {
    background: #F7FAFC;  /* 浅灰背景 */
    color: #1A202C;  /* 深色文字 */
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #E2E8F0;
    font-size: 12px;
    line-height: 1.6;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

/* 代码注释颜色 */
.response-text pre .comment {
    color: #718096;  /* 灰色 */
}

/* 错误信息样式 */
.response-text .error {
    color: #E53E3E;  /* 红色 */
    background: #FFF5F5;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #FED7D7;
    margin: 8px 0;
}

/* 成功信息样式 */
.response-text .success {
    color: #2F855A;  /* 绿色 */
    background: #F0FFF4;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #C6F6D5;
    margin: 8px 0;
}

/* 警告信息样式 */
.response-text .warning {
    color: #C05621;  /* 橙色 */
    background: #FFFAF0;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #FEEBC8;
    margin: 8px 0;
}

/* 链接样式 */
.response-text a {
    color: #4C51BF;  /* 紫色 */
    text-decoration: none;
    border-bottom: 1px dashed #4C51BF;
}

.response-text a:hover {
    color: #5A67D8;
    border-bottom-style: solid;
}

/* 高亮文本样式 */
.response-text .highlight {
    background: #EBF4FF;  /* 浅蓝背景 */
    color: #2B6CB0;  /* 蓝色文字 */
    padding: 2px 4px;
    border-radius: 3px;
}

/* 引用文本样式 */
.response-text blockquote {
    border-left: 3px solid #7F7FD5;  /* 紫色边框 */
    margin: 8px 0;
    padding: 8px 16px;
    background: #F7FAFC;
    color: #4A5568;
    font-style: italic;
}

/* 列表样式 */
.response-text ul, .response-text ol {
    color: #2D3748;
    margin: 8px 0;
    padding-left: 20px;
}

.response-text li {
    margin: 4px 0;
}

/* 表格样式 */
.response-text table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
}

.response-text th {
    background: #EDF2F7;
    color: #2D3748;
    font-weight: 600;
    padding: 8px;
    border: 1px solid #E2E8F0;
}

.response-text td {
    padding: 8px;
    border: 1px solid #E2E8F0;
    color: #4A5568;
}

/* 添加隐藏 */
.hidden {
    display: none !important;
}

/* 修改按钮布局 */
.panel-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 8px 0;
    border-bottom: 1px solid #E2E8F0;
    margin: 0;
}

/* 清空按钮特殊样式 */
#clearBtn {
    background-color: #fff;
    color: #718096;  /* 默认使用灰色 */
    border: 1px solid #E2E8F0;  /* 默认使用浅灰色边框 */
    transition: all 0.2s ease;  /* 添加过渡效果 */
}

#clearBtn:hover {
    background-color: #FFF5F5;
    border-color: #E53E3E;  /* 悬停时显示红色边框 */
    color: #E53E3E;  /* 悬停时文字变红 */
}

/* 清空按钮图标动画 */
#clearBtn span {
    transition: transform 0.2s ease;
}

#clearBtn:hover span {
    transform: rotate(15deg);
}

/* 截图完成状态 - 使用活力红色渐变 */
.response-container h3.status-captured {
    color: #E53E3E;
    background: linear-gradient(90deg, #F56565 0%, #FC8181 100%);  /* 鲜红到浅红的渐变 */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s linear infinite;
    background-size: 200% auto;
}

/* 发送状态 - 使用活力红色渐变 */
.response-container h3.status-sending {
    color: #E53E3E;
    background: linear-gradient(90deg, #E53E3E 0%, #FC8181 100%);  /* 鲜红到浅红的渐变 */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s linear infinite;
    background-size: 200% auto;
}

.panel-header .panel-controls {
    display: flex;
    gap: 4px;
}

.panel-header .close-btn {
    cursor: pointer;
    color: #666;
    font-size: 18px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
}

.panel-header .close-btn:hover {
    background-color: #ff4d4f;
    color: white;
}

/* 调整最小化按钮样式以匹配 */
.panel-header .minimize-btn {
    cursor: pointer;
    color: #666;
    font-size: 18px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
}

.panel-header .minimize-btn:hover {
    background-color: #1890ff;
    color: white;
}
 